package com.ts.api.module.match.market.internal.executor.model;

import com.ts.api.module.channel.entity.ChannelRequest;
import com.ts.api.module.channel.entity.po.ChannelMarketPO;
import lombok.Data;

import java.util.List;

/**
 *  渠道贷超撞库执行器对象
 *
 *  @author Pan
 */
@Data
public class MarketExecuteDataExchange {

    /** 验证通过的渠道列表 **/
    private List<ChannelMarketPO> listMarketValidate;
    /**  **/
    private ChannelMarketPO marketSort;
    /** 渠道请求上下文对象 */
    private ChannelRequest channelRequest;

    /**
     *  构建
     *
     *  @param  listMarketValidate  返回验证通过的渠道列表
     *  @param  channelRequest      渠道请求上下文对象
     *  @return MarketExecuteDataExchange
     */
    public static MarketExecuteDataExchange of(List<ChannelMarketPO> listMarketValidate, ChannelRequest channelRequest) {
        MarketExecuteDataExchange exchange = new MarketExecuteDataExchange();
        exchange.setListMarketValidate(listMarketValidate);
        exchange.setChannelRequest(channelRequest);
        return exchange;
    }

    /**
     *  构建
     *
     *  @param  marketSort          已经排序过后的贷超对象
     *  @param  listMarketValidate  返回验证通过的渠道列表
     *  @param  channelRequest      渠道请求上下文对象
     *  @return MarketExecuteDataExchange
     */
    public static MarketExecuteDataExchange ofSort(ChannelMarketPO marketSort, List<ChannelMarketPO> listMarketValidate, ChannelRequest channelRequest) {
        MarketExecuteDataExchange exchange = new MarketExecuteDataExchange();
        exchange.setMarketSort(marketSort);
        exchange.setListMarketValidate(listMarketValidate);
        exchange.setChannelRequest(channelRequest);
        return exchange;
    }

}
